package cn.tuning.utils;

/**
 * @author lixiaolong
 * @date 2021-08-06 21:40
 * @description:
 */
public enum ResultCode {
    /**
     * 返回码和状态说明
     */
    SUCCESS(HttpStatus.SUCCESS, "SUCCESS"),
    BAD_REQUEST(HttpStatus.BAD_REQUEST, "参数缺失"),
    UNAUTHORIZED(HttpStatus.UNAUTHORIZED, "认证失败"),
    LOGIN_ERROR(HttpStatus.UNAUTHORIZED, "登陆失败,密码错误"),
    FORBIDDEN(HttpStatus.FORBIDDEN, "权限不足,禁止访问"),
    NOT_FOUND(HttpStatus.NOT_FOUND, "请求的资源不存在"),
    OPERATE_ERROR(HttpStatus.BAD_METHOD, "操作失败,请求操作的资源不存在"),
    TIME_OUT(HttpStatus.TIME_OUT, "请求超时"),
    SERVER_ERROR(HttpStatus.ERROR, "服务器内部错误"),
    REGISTER_SUCCESS(HttpStatus.SUCCESS, "帐号注册成功"),
    NOT_FOUND_RIDER(HttpStatus.BAD_REQUEST, "骑手尚未注册,请先注册骑手"),
    LOGIN_ERROR_MASSAGE(HttpStatus.BAD_REQUEST,"登录失败,信息缺失无法登陆"),
    LOGIN_ERROR_USERNAME(HttpStatus.UNAUTHORIZED,"登陆失败,邮箱不存在,请注册"),
    REGISTER_ERROR(HttpStatus.UNAUTHORIZED,"邮箱已存在"),
    VERIFY_ERROR(HttpStatus.BAD_REQUEST,"邮箱不能为空"),
    ERROR_MAIL(HttpStatus.BAD_REQUEST,"邮箱格式错误,请输入正确的邮箱"),
    VERIFY_CODE_ERROR(HttpStatus.BAD_REQUEST,"验证码错误"),
    NOT_LOGIN(HttpStatus.BAD_REQUEST,"你尚未登录,请先登录"),
    INPUT_NOT_FULL(HttpStatus.BAD_REQUEST,"输入信息不全"),
    REGISTER_FAIL(HttpStatus.ERROR, "帐号注册失败");



    private final int code;

    private final String msg;

    ResultCode(int code, String msg)
    {
        this.code = code;
        this.msg = msg;
    }

    public int getCode()
    {
        return code;
    }

    public String getMsg()
    {
        return msg;
    }

}
